import axios from '@/utils/request'

// 上传问题
export function uploadQuestion(data) {
  return axios.post('/questions', data);
}

// 根据id查询问题
export function getQuestionById(id) {
  return axios.get(`/questions/${id}`);
}

export function getQuestionsOrderByDESC(pageNum, pageSize) {
  return axios.get('/questions/desc', {
    params: {
      pageNum: pageNum,
      pageSize: pageSize
    }
  })
}

// 获取用户最近提问
export function getQuestionsByUserIdOrderByDESC(userId, pageNum, pageSize) {
  return axios.get('/questions/user', {
    params: {
      userId,
      pageNum,
      pageSize
    }
  });
}
